<?php
// #region demo
$link = mysqli_connect('127.0.0.1', 'root', 'root', 'test');

if ($link === false) {
    exit("Link connection failed.");
}

$result = mysqli_query($link, "SELECT * FROM users");

if ($result instanceof mysqli_result) {
    while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
        if (is_array($row)) {
            echo sprintf("account => %s, password => %s" . PHP_EOL, $row['account'], $row['password']);
        }
    }
}
// #endregion demo
